package com.googlecode.rulio.examples;

import com.googlecode.rulio.Action;
import com.googlecode.rulio.ActivatingAction;

import static com.googlecode.rulio.Rules.action;

public class LogDogToFileAction extends Action<Dog, Void> {
    private LogFilePath filename;
    private ServiceDependency dependency;

    public LogDogToFileAction(LogFilePath filename, ServiceDependency dependency) {
        this.filename = filename;
        this.dependency = dependency;
    }

    public Void execute(Dog value) {
        return null;
    }

    @Override
    public String toString() {
        return "LogToFile(" + filename + ", " + dependency.getValue() + ")";

    }

    public static ActivatingAction<? extends Action<? super Dog, ?>> logToFile(LogFilePath filename) {
        return action(LogDogToFileAction.class, filename);

    }


    public static LogDogToFileAction logToFile(LogFilePath filename, ServiceDependency dependency) {
        return new LogDogToFileAction(filename, dependency);
    }


}
